<!DOCTYPE html>
<html>
  <head>
    <title>个人中心</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=no">
	<meta charset="utf-8">
    <!-- Bootstrap -->
    <link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/bootstrap.min.css">
    <link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/reset.css">
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
    <script src="__PUBLIC__/addon/malltemplatehome/js/jquery-1.11.3.min.js"></script>
    <!-- Include all compiled plugins (below), or include individual files as needed -->
    <script src="__PUBLIC__/addon/malltemplatehome/js/bootstrap.js"></script>
	<!--自己的css样式-->
	<link rel="stylesheet" href="__PUBLIC__/addon/malltemplatehome/CSS/store.css">
  </head>
  <body>
	<!--nav部分开始-->
	<header id="header">
		<div class="row shopping">
		<a href="__APP__/Home/Mall/Index/Addon/MallTemplateHome.html">
			
			<div class="col-xs-2 col-sm-2">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon58.jpg" width="100%">
			</div>
			</a>
			<div class="col-xs-8 col-sm-8">
				个人中心
			</div>
			<div class="col-xs-2 col-sm-2">
			</div>
		</div>
	</header>
	<!--content-->
	<div id="my">
		<div class="row">
			<div class="col-xs-4 col-sm-4">
				<img src="{$user.img}">
			</div>
			<div class="col-xs-8 col-sm-8">
				<p>昵称：{$user.nickname}</p>
				<p>积分：{$user.integral}分</p>
				<p>余额：￥{$user.money}元</p>
			</div>
		</div>
	</div>
	
	<!--jiage-->
	<div id="vouchers">
		<a href="__APP__/Home/Mall/Order/Addon/MallTemplateHome/type/3.html">
		
		<div class="row">
			<span>已完成订单</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<a href="__APP__/Home/Mall/Order/Addon/MallTemplateHome/type/1.html">
		
		<div class="row">
			<span>待付款订单</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<a href="__APP__/Home/Mall/Order/Addon/MallTemplateHome/type/2.html">
		
		<div class="row">
			<span>待收货订单</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<a href="__APP__/Home/Recharge/Goods/Addon/WeiXin.html">
		
		<div class="row">
			<span>我要充值</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<a href="__APP__/Home/Mall/Money/Addon/MallTemplateHome.html">
		
		<div class="row">
			<span>我的财务</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<a href="__APP__/Home/OAuth/Address/Addon/WeiXin.html">
		<div class="row">
			<span>配送地址管理</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		
		<if condition="$user.partner eq 1"> 
		<a href="__APP__/Home/OAuth/Address/Addon/WeiXin.html">
		<div class="row">
			<span>我是合伙人</span>
			<span class="pull-right"><img src="__PUBLIC__/addon/malltemplatehome/images/icon10.jpg"></span>
		</div>
		</a>
		<else /> 
		
		</if>
		
	</div>
	

	<!--底部-->
	<div id="bottom">
		<div class="row">
			<a href="__APP__/Home/Mall/Index/Addon/MallTemplateHome.html">
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon8.jpg">
				<p>首页</p>
			</div>
			</a>
			<a href="__APP__/Home/Mall/Cart/Addon/MallTemplateHome.html">
			
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon6.jpg">
				<p>购物车</p>
			</div>
			</a>
			<a href="__APP__/Home/Mall/MyInfo/Addon/MallTemplateHome.html">
			
			<div class="col-xs-4 col-sm-4">
				<img src="__PUBLIC__/addon/malltemplatehome/images/icon7.jpg">
				<p>我的</p>
			</div>
			</a>
		</div>
	</div>
	<script>
		$(function(){
			$(".caigou-contentl .pull-right .left").bind('click',function(){
				var oldNum=$(this).next().val();
				var newNum=oldNum-1;

				
				var jiage=$(this).parent().parent().prev().find('.good').text();
				var aa=jiage.substr(5)
				var total=Number(aa)*Number(newNum)
				$(this).parent().parent().next().find('span').eq(1).text(total.toFixed(2))
				console.log(total)
				
				
				if(newNum<1){
					if(confirm("确认删除缤纷果汁？")){
						$(this).parent().parent().parent().parent().addClass('hide')
						$(this).next().val(0)
						shp()
						gongji()
					}else{
						return false;
					}
				}else{
					$(this).next().val(newNum)
				}
				shp()
				gongji()
				
			})
			$(".caigou-contentl .pull-right .right").bind('click',function(){
				var oldNum=$(this).prev().val();
				var newNum=Number(oldNum)+1;
				$(this).prev().val(newNum)
				
				var jiage=$(this).parent().parent().prev().find('.good').text();
				var aa=jiage.substr(5)
				var total=Number(aa)*Number(newNum)
				$(this).parent().parent().next().find('span').eq(1).text(total.toFixed(2))
				console.log(total)
				shp()
				gongji()
				

			})
			$(".caigou-contentl .close").bind('click',function(){
				if(confirm("确认删除缤纷果汁？")){
					$(this).parent().parent().parent().addClass('hide')
					$(this).parent().next().find('input').val(0)
					shp()
					gongji()
					
				}else{
					return false;
				}
			})
			
			function shp(){
				var heji=0;
				$('.caigou-contentl .shuliang').each(function(){
					var jiage=$(this).children().eq(1).find('.good').text();
					var aa=jiage.substr(5)
					
					var num=$(this).children().eq(2).find('input').val();
					heji+=Number(aa)*Number(num)

					
					$('#jisuan .row').eq(0).find('.pull-right').text('￥'+(heji.toFixed(2)))
				})
			}
			shp()
			
			function gongji(){
				var zonghe=0;
				$('#jisuan .total').each(function(){
					var jiage=$(this).children().find('.pull-right').text();
					var aa=jiage.substr(1)
					console.log(aa)
					zonghe+=Number(aa)
		
					
					$('#jisuan .jisuan-total').find('.pull-right').text('￥'+(zonghe.toFixed(2)))
				})
			}
			gongji()
			
		
		})
	</script>
	<script>
		
	</script>
  </body>
</html>